// src/utils/cookie.js
export const setCookie = (name, value, days = 7) => {
    const expires = new Date();
    expires.setTime(expires.getTime() + days * 24 * 60 * 60 * 1000);
    document.cookie = `${name}=${value}; expires=${expires.toUTCString()}; path=/; secure`;
  };
  
  export const getCookie = (name) => {
    const match = document.cookie.match(new RegExp(`(^| )${name}=([^;]*)`));
    return match ? decodeURIComponent(match[2]) : null;
  };
  
  export const deleteCookie = (name) => {
    document.cookie = `${name}=; max-age=0; path=/`;
  };
  